<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">


<ui:composition template="/WEB-INF/template.xhtml">
	<ui:define name="center">
<h:body>
 
 <h:form>    
                 <h:selectOneMenu id="categorie" value="#{proposExamMCBean.exam.categorie}" required="true">  
                 <f:selectItem itemLabel="Selectionner la catégorie" itemValue="" />  
                 <f:selectItems value="#{proposExamMCBean.listCategories}" />  
                 </h:selectOneMenu>
                 
                  <h:outputLabel for="Titre" value="Titre de L'Examen" />
				  <p:inputText value="#{proposExamMCBean.exam.titre}" id="Titre" required="true" label="Titre" />
                  <p:separator />  
    <h:dataTable Rules="all"  value="#{proposExamMCBean.questions}"  var="quest">
     <p:column>

      <ui:repeat value="Question N° #{quest.ordre}" var="ordre" >
        #{ordre}
    </ui:repeat>
     </p:column>
    
    <h:column>
      <f:facet name="header">
      <h:outputText value="Question" />
      </f:facet>
      <h:inputTextarea rows="3" cols="50" value="#{quest.question}" queryDelay="150" minQueryLength="4"  />
    </h:column>
    <h:column>
      <f:facet name="header">
      <h:outputText value="Choix 1" />
      </f:facet>
      <h:inputTextarea rows="2" cols="50" value="#{quest.choix[0].choix}"  queryDelay="150" minQueryLength="4"  />
      <p:selectOneButton value="#{quest.choix[0].bonReponse}" required= "true">  
            <f:selectItem itemLabel="Vrai" itemValue="true" />  
            <f:selectItem itemLabel="Faux" itemValue="false" />   
        </p:selectOneButton>  
    </h:column>
    <h:column>
      <f:facet name="header">
      <h:outputText value="Choix 2" />
      </f:facet>
      <h:inputTextarea rows="2" cols="50" value="#{quest.choix[1].choix}"  queryDelay="150" minQueryLength="4"  />
      <p:selectOneButton value="#{quest.choix[1].bonReponse}" required= "true">  
            <f:selectItem itemLabel="Vrai" itemValue="true" />  
            <f:selectItem itemLabel="Faux" itemValue="false" />   
        </p:selectOneButton>  
    </h:column>
    <h:column>
      <f:facet name="header">
      <h:outputText value="Choix 3" />
      </f:facet>
      <h:inputTextarea rows="2" cols="50" value="#{quest.choix[2].choix}"  queryDelay="150" minQueryLength="4" />
    <p:selectOneButton value="#{quest.choix[2].bonReponse}" required= "true">  
            <f:selectItem itemLabel="Vrai" itemValue="true" />  
            <f:selectItem itemLabel="Faux" itemValue="false"/>  
        </p:selectOneButton>  
    </h:column>
  </h:dataTable>
     <p:separator />  
   <p:commandButton action="#{proposExamMCBean.newExamMC}"  type="submit" value="Valider"/>
</h:form>
 
</h:body>
	</ui:define>
	
</ui:composition>
</html>